package com.codingapi.websocket.core.client;

import com.codingapi.websocket.core.handler.WebSocketHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.HttpHeaders;
import io.netty.handler.codec.http.websocketx.WebSocketFrame;
import io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker;
import io.netty.handler.codec.http.websocketx.extensions.WebSocketExtension;

import java.net.InetSocketAddress;
import java.net.URI;
import java.security.Principal;
import java.util.List;
import java.util.Map;

/**
 * @author modificial
 * @date 2018/7/19
 * @company codingApi
 * @description 会话
 */
public interface WebSocketSession {

    Map<String, List<String>> getParameters();

    String getId();

    URI getUri();

    HttpHeaders getHandshakeHeaders();

    Map<String, Object> getAttributes();

    Principal getPrincipal();

    InetSocketAddress getLocalAddress();

    InetSocketAddress getRemoteAddress();

    String getAcceptedProtocol();

    List<WebSocketExtension> getExtensions();

    void sendMessage(WebSocketFrame webSocketFrame);

    boolean isOpen();

    void close();

    ChannelHandlerContext getChannelHandlerContext();

    WebSocketHandler getWebSocketHandler();

    WebSocketServerHandshaker getWebSocketServerHandshaker();


}
